<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="../../../include/admincontent.jsp" %>
<% String basepaths = request.getContextPath(); %>
<%--<div id="location">当前位置：首页 > 招聘实施 > 中专校园招聘 > 体检</div>--%>
<div id="Content" style="min-width: 1850px">
<%--    <div class="btnbar">
        <button type="button" class="view" id="zzuser_view">查看毕业生信息</button>
        <button type="button" class="list" id="zzuser_tjplan">体检安排</button>
        <button type="button" class="list" id="zzuser_tjmsg">发布体检通知</button>
       &lt;%&ndash; <button type="button" class="import" id="tj_out">导出人员信息</button>&ndash;%&gt;
        <button type="button" class="save" id="tj_result">修改体检结果</button>
        <button type="button" class="card" id="zzpublishresult" fid="${fid}" deptcode="${deptcode}">公布/屏蔽结果</button>
        <button type="button" class="list" id="do_zznext">进入下一步</button>
        <button type="button" class="save" id="resume_input">导入</button>
        <button type="button" class="save" id="resume_output">导出</button>
        <button type="button" class="list" id="do_tjgw" pid="${pid}" fid="${fid}" deptcode="${deptcode}">推荐其他岗位</button>
    </div>--%>

    <div class="toolbars" style="height:30px;white-space:nowrap;width:auto;margin-left: 10px;" totalwidth="314">
        <a id="zzuser_view">
            <em class="ico16 view_list_16"></em>
            <span class="menu_span" title="查看毕业生信息">查看毕业生信息</span>
        </a>
        <a id="zzuser_tjplan" style="margin-left: 5px">
            <em class="ico16 sort_text_16"></em>
            <span class="menu_span" title="体检安排">体检安排</span>
        </a>
        <a id="tj_assignment" style="margin-left: 5px">
            <em class="ico16 grid_listview"></em>
            <span class="menu_span" title="一键分配">一键分配</span>
        </a>
        <a id="zzuser_tjmsg" style="margin-left: 5px">
            <em class="ico16 publish_16"></em>
            <span class="menu_span" title="发布体检通知">发布体检通知</span>
        </a>
        <a id="tj_result" style="margin-left: 5px">
            <em class="ico16 receive_16"></em>
            <span class="menu_span" title="修改体检结果">修改体检结果</span>
        </a>
        <a id="gxpublisharrange" style="margin-left: 5px">
            <em class="ico16 plan_16"></em>
            <span class="menu_span" title="公布/屏蔽安排" fid="${fid}" deptcode="${deptcode}">公布/屏蔽安排</span>
        </a>
        <a id="zzpublishresult" style="margin-left: 5px">
            <em  class="ico16 plan_16"></em>
            <span  class="menu_span" title="公布/屏蔽结果" fid="${fid}" deptcode="${deptcode}">公布/屏蔽结果</span>
        </a>
        <a id="do_zznext" style="margin-left: 5px">
            <em  class="ico16 more_blue"></em>
            <span  class="menu_span" title="进入下一步">进入下一步</span>
        </a>
        <a id="resume_output" style="margin-left: 5px">
            <em  class="ico16 behavioranalysis_down"></em>
            <span  class="menu_span" title="导出">导出</span>
        </a>
        <a id="resume_input" style="margin-left: 5px">
            <em  class="ico16 behavioranalysis_up"></em>
            <span  class="menu_span" title="导入">导入</span>
        </a>
        <a id="do_tjgwNew" style="margin-left: 5px">
            <em  class="ico16 sort_ch_16"></em>
            <span  class="menu_span" title="推荐其他岗位"  pid="${pid}" fid="${fid}" deptcode="${deptcode}">推荐其他岗位</span>
        </a>
        <a id="send_news" style="margin-left: 5px">
            <em  class="ico16 info_16"></em>
            <span  class="menu_span" title="消息通知">消息通知</span>
        </a>
    </div>

    <!-- 体检安排 --><%--class="condition_cont"--%>
    <div id="planpanel" style="height: 400px;display: none">
        <form id="thisform1" method="post" action="${path}/Do/ZZPhysical/PlanAction">
            <input type="hidden" name="pid" value="${pid}"/>
            <input type="hidden" name="fid" value="${fid}"/>
            <input type="hidden" name="deptcode" value="${deptcode}"/>
            <table class="treeTable searchform">
                <thead>
                <tr>
                    <td width="60">体检时间：</td>
                    <td width="150">
                        <div>
                            <input type="text" name="tjtime" datatype="*" nullmsg="体检时间不能为空！" class="select"
                                   onFocus="blur()"
                                   onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm',min:''})"/>
                        </div>
                    </td>
                    <td width="60">体检地点：</td>
                    <td width="300">
                        <div>
                            <select type="text" name="tjaddress" datatype="*" nullmsg="体检地点不能为空！">${address}</select>
                        </div>
                    </td>

                    <td></td>
                </tr>
                <tr>
                    <td>联 系 人：</td>
                    <td>
                        <div><input type="text" name="tjlxr" /></div>
                    </td>
                    <td>联系电话：</td>
                    <td>
                        <div><input type="text" name="tjlxdh" /></div>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td>注意事项：</td>
                    <td colspan="3">
                        <div>
<%--                            <textarea name="tjzysx" id="tjzysx" style="width:99%;height:150px;"> ${tjzysx}</textarea>--%>
                            <textarea name="tjzysx" id="tjzysx" style="height:auto;overflow-x:visible;overflow-y:visible;">${tjzysx}</textarea>
                        </div>
                    </td>
                    <%--<td style="text-align:left" >体检注意事项,如无注意事项<a href="javascript:clearZysx()">清除</a>内容即可</td>--%>
                    <td style="text-align:left">体检注意事项</td>
                </tr>
                <tr>
                    <td></td>
                    <td colspan="1" style="text-align:right">
                        <button type="submit" class="save">提 交</button>
                    </td>
                    <td   colspan="3"  style="text-align:left">系统提示：参加体检的人员请从下面列表中勾选</td>
                </tr>
                </thead>
            </table>
            <div id="tjusers"></div>
        </form>
    </div>

    <!-- 体检通知 -->
    <div id="msgpanel" class="condition_cont">
        <form id="thisform2" method="post" action="${path}/Do/ZZPhysical/MsgAction">
            <input type="hidden" name="pid" value="${pid}"/>
            <input type="hidden" name="fid" value="${fid}"/>
            <input type="hidden" name="deptcode" value="${deptcode}"/>
            <table class="treeTable searchform">
                <thead>
                <tr>
                    <td width="60">体检时间：</td>
                    <td width="200">
                        <div><select name="tjtime" datatype="*" nullmsg="体检时间不能为空！">${tjtime}</select></div>
                    </td>
                    <td width="60">短信模版：</td>
                    <td width="200">
                        <div><select id="dxmb" datatype="*" nullmsg="短信模版不能为空！">${dxmb}</select></div>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td>短信内容：</td>
                    <td colspan="3">
                        <div><textarea name="dxnr" datatype="*" nullmsg="短信内容不能为空！"></textarea></div>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td colspan="3">
                        <button type="submit" class="save">提 交</button>
                    </td>
                    <td></td>
                </tr>
                </thead>
            </table>
            <div id="msgusers"></div>
        </form>
    </div>

    <!-- 体检结果 -->
    <div id="resultpanel" class="condition_cont">
        <form id="thisform3" method="post" action="/Do/ZZPhysical/RAction?fid=${fid}&deptcode=${deptcode}">
            <table class="treeTable searchform">
                <thead>
                <tr>
                    <td width="55">体检结果:</td>
                    <td width="100">
                        <div>
                            <select name="tjstate">
                                <option value="未体检">未体检</option>
                                <option value="合格">合格</option>
                                <option value="不合格">不合格</option>
                                <option value="复查">复查</option>
                                <option value="身高不符">身高不符</option>
                                <option value="会诊">会诊</option>
                            </select>
                        </div>
                    </td>
                    <td width="30">备注:</td>
                    <td width="300">
                        <div><input type="text" name="tjremark"/></div>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td colspan="4">
                        <button type="submit" class="op">修改体检结果</button>
                    </td>
                </tr>
                </thead>
            </table>
            <div id="rusers"></div>
        </form>
    </div>

    <!-- 消息通知 -->
    <div id="infospanel"  class="condition_cont">
        <form id="infosform" method="post" action="/Do/SendInfos/SendInfosAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}">
            <table class="treeTable searchform">
                <thead>
                <tr>
                    <td width="100">消息内容:</td>
                    <td width="500">
                        <div><textarea name="infoContent" datatype="*" nullmsg="消息内容不能为空！"></textarea></div>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <button type="submit" class="op">发送消息通知</button>
                    </td>
                    <td></td>
                </tr>
                </thead>
            </table>
            <div id="infosuers"></div>
            <div id="infosuerCardnos"></div>
        </form>
    </div>

    <!-- 筛选条件 -->
    <div id="searchbox">
        <form id="sform">
            <input type="hidden" name="pid" value="${pid}"/>
            <input type="hidden" name="path" value="${fid}"/>
            <input type="hidden" name="deptcode" value="${deptcode}"/>
            <%--<table class="treeTable searchform">
                <thead>
                <tr>
                    <td width="60">学校名称：</td>
                    <td width="200">
                        <div><select name="adduid">${school}</select></div>
                    </td>
                    <td width="60">人员姓名：</td>
                    <td width="120">
                        <div><input type="text" name="name"/></div>
                    </td>
                    <td width="60">身份证号：</td>
                    <td width="120">
                        <div><input type="text" name="code"/></div>
                    </td>
                    <td width="30">
                        <button id="searchbtn" type="button" class="search"></button>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td>体检时间：</td>
                    <td>
                        <div><select name="tjtime">
                            <option value="">全部</option>
                            ${tjtime}</select></div>
                    </td>
                    <td>短信通知：</td>
                    <td>
                        <div><select name="tjmsg">
                            <option value="">全部</option>
                            <option value="已发通知">已发通知</option>
                            <option value="未发通知">未发通知</option>
                        </select></div>
                    </td>
                    <td>体检结果：</td>
                    <td>
                        <div><select name="tjstate">
                            <option value="">全部</option>
                            <option value="未体检">未体检</option>
                            <option value="已通过">已通过</option>
                            <option value="未通过">未通过</option>
                        </select></div>
                    </td>
                    <td colspan="2"></td>
                </tr>
                </thead>
            </table>--%>

            <table class="treeTable searchform">
                <thead>
                <tr>
                    <td width="60">毕业院校:</td>
                    <td width="160">
                        <div>
                            <select name="adduid">
                                <option value="">全部</option>
                                ${school}
                            </select>
                        </div>
                    </td>
                    <td width="60">身份证号:</td>
                    <td>
                        <div><input type="text" name="code"/></div>
                    </td>

                    <td width="60">姓名:</td>
                    <td >
                        <div>
                            <input type="text" name="name"/>
                        </div>
                    </td>
                    <td width="60">所学专业:</td>
                    <td >
                        <div>
                            <input type="text" name="major"/>
                        </div>
                    </td>
                    <td width="60">毕业年份:</td>
                    <td>
                        <div><input type="text" name="graduationyear"/></div>
                    </td>
                </tr>
                <tr>

                    <td>联系电话:</td>
                    <td>
                        <div>
                            <input type="text" name="tel"/>
                        </div>
                    </td>
                    <td width="60">岗位组:</td>
                    <td width="120">

                        <div><select name="job">
                            <option value="">不限</option>
                            <c:forEach var="projectinfojobs" items="${jobs}" varStatus="item" >
                                <c:choose>
                                    <c:when test="${projectinfojobs!=null}">
                                        <option value="${projectinfojobs.jobname}">${projectinfojobs.jobname}</option>
                                    </c:when>

                                </c:choose>
                            </c:forEach>
                            </select>
                        </div>
                    </td>
                    <td width="60">体检安排：</td>
                    <td width="120">
                        <div>
                            <select name="tjarrange">
                                <option value="">全部</option>
                                <option value="已安排">已安排</option>
                                <option value="未安排">未安排</option>
                            </select>
                        </div>
                    </td>
                    <td width="60">体检结果：</td>
                    <td width="120">
                        <div><select name="tjstate">
                            <option value="">全部</option>
                            <c:forEach var="projectstates" items="${states}" varStatus="item" >
                                <c:choose>
                                    <c:when test="${projectstates!=null}">
                                        <option value="${projectstates}">${projectstates}</option>
                                    </c:when>
                                </c:choose>
                            </c:forEach>
                        </select></div>
                    </td>
                    <td width="60">放弃状态：</td>
                    <td width="160">
                        <div>
                            <select name="fqstate">
                                <option value="">全部</option>
                                <option value="未放弃" selected>未放弃</option>
                                <option value="已放弃">已放弃</option>
                            </select>
                        </div>
                    </td>
                </tr>
                <tr class="moretj">

                    <td width="60">短信通知:</td>
                    <td width="160">
                        <div><select name="tjmsg">
                            <option value="">全部</option>
                            <option value="已发通知">已发通知</option>
                            <option value="未发通知">未发通知</option>
                        </select></div>
                    </td>
                    <td width="60">性别:</td>
                    <td width="150">
                        <div>
                            <select name="gender">
                                <option value="">不限</option>
                                <option value="男">男</option>
                                <option value="女">女</option>
                            </select>
                        </div>
                    </td>
                    <td width="60" style="text-align:right;">年龄:</td>
                    <td width="150">
                        <div><input type="text" name="agefrom" style="max-width: 40%"/>至<input type="text" name="ageto" style="max-width: 40%"/></div>
                    </td>
                    <td width="60" style="text-align:right;">身高:</td>
                    <td width="150">
                        <div><input type="text" name="heightfrom" style="max-width: 40%"/>至<input type="text" name="heightto" style="max-width: 40%"/></div>
                    </td>
                    <td width="60">是否转岗:</td>
                    <td width="100">
                        <div>
                            <select name="ischangejob">
                                <option value="">全部</option>
                                <option value="是">是</option>
                                <option value="否">否</option>
                            </select>
                        </div>
                    </td>
                    <td colspan="3"></td>
                </tr>
                <%--<tr class="moretj">
                    <td>性别:</td>
                    <td>
                        <div>
                            <select name="gender">
                                <option value="">不限</option>
                                <option value="男">男</option>
                                <option value="女">女</option>
                            </select>
                        </div>
                    </td>

                    <td>户口所在地:</td>
                    <td>
                        <div><input type="text" name="hukouaddress"/></div>
                    </td>
                    <td>现居住地:</td>
                    <td colspan="3">
                        <div><input type="text" name="nowaddress"/></div>
                    </td>
                    <td>筛选状态:</td>
                    <td colspan="3">
                        <div>
                            <select name="fqstate">
                                <option value="">全部</option>
                                <option value="未放弃" selected>未放弃</option>
                                <option value="已放弃">已放弃</option>
                            </select>
                        </div>
                    </td>
                    <td></td>
                </tr>--%>
                <tr>
                    <td colspan="2">
<%--                        <div style="padding-top: 8px;">
                            <button id="searchbtn" type="button" class="search"></button>
                            <button id="clearbtn" type="reset" class="del" title="清除" style="flex: 1;margin-left: 5px;"></button>
                        </div>--%>
                        <div class="toolbars">
                            <a id="searchbtn">
                                <em class="ico16 search_16"></em>
                                <span >查询</span>
                            </a>
                            <a id="clearbtn">
                                <em class="ico16 refresh_16"></em>
                                <span>清除</span>
                            </a>
                        </div>
                    </td>
                    <td colspan="8">
<%--                        <button id="showhidebtn" type="button" class="moretjbtn0" onclick="moreparam()"
                                title="高级查询"></button>--%>
                        <div class="toolbars">
                            <a onclick="moreparam()">
                                <em class="ico16 search_disable_16"></em>
                                <span >高级查询</span>
                            </a>
                        </div>
                    </td>
                </tr>
                </thead>
            </table>
        </form>
    </div>
<%--    <form id="Validform" method="post" action="${path}/Do/ZZPhysical/RAction">
        <input type="hidden" name="fid" value="${fid}" />
        <input type="hidden" name="deptcode" value="${deptcode}" />
        <button type="submit" id="okbtn" style="display:none;"></button>
        <div id="page_top" class="page"></div>
        <table class="treeTable" id="tablelist">
            <thead>
            <tr>
                <td width="20"><input type="checkbox" class="allcheckbox" title="选择全部/取消全选"/></td>
                <td width="25">序号</td>
                <td width="120">姓名</td>
                <td width="30">性别</td>
                <td width="110">身份证号</td>
                <td width="120">专业</td>
                <td width="70">岗位</td>
                <td width="100">体检时间</td>
                <td width="160">体检地点</td>
                <td width="100">联系人</td>
                <td width="70">短信通知</td>
                <td width="60">体检结果</td>
                <td width="60">体检备注</td>
                <td width="50">公布结果</td>
                <td width="45"></td>
            </tr>
            </thead>
            <tbody id="result"></tbody>
        </table>
    </form>
    <div id="page_bottom" class="page"></div>--%>
    <table class="layui-hide" id="tablelistZzPhysical" lay-filter="listTables"></table>
</div>
<script type="text/javascript">
    $("#searchbox").width($(window).width()-10);

    var ptypes = "ZZPhysical";

    //消息通知
    $('#send_news').on('click',function () {
        getTableChecks();

        $('#infospanel').slideToggle(300);
        $(this).toggleClass('cur').blur().siblings().removeClass('cur');
        if (!$('#msgpanel').is(":hidden")) {
            $('#msgpanel').slideToggle(300);
        }
        if (!$('#resultpanel').is(":hidden")) {
            $('#resultpanel').slideToggle(300);
        }
    });

    /*    var editor;
    KindEditor.ready(function (K) {
          editor= K.create('#tjzysx', {
              resizeType: 1,
              items: [ 'removeformat'],
              afterBlur: function () {
                  this.sync();
              }
          });
      });
      function clearZysx() {
          editor.html('');
      }
  */

    //  $(document).ready(function () {
        getMsg();
       // getList();
      /*  $('#searchbtn').on('click',function () {
            $('#tjusers').html('');
            $('#msgusers').html('');
            $('#rusers').html('');
            getList();
        });*/

        $('#clearbtn').on('click',function () {
            document.getElementById("sform").reset();
        });

        $('#tj_result').click(function () {
            getTableChecks();
            $('#resultpanel').slideToggle(300);
            $(this).toggleClass('cur').blur().siblings().removeClass('cur');
           /* if (!$('#planpanel').is(":hidden")) {
                $('#planpanel').slideToggle(300);
            }*/
            if (!$('#msgpanel').is(":hidden")) {
                $('#msgpanel').slideToggle(300);
            }
            if (!$('#infospanel').is(":hidden")) {
                $('#infospanel').slideToggle(300);
            }
        });

        //体检安排
        $('#zzuser_tjplan').click(function () {
               /* $('#planpanel').slideToggle(300);
                $(this).toggleClass('cur').blur().siblings().removeClass('cur');
                if (!$('#msgpanel').is(":hidden")) {
                    $('#msgpanel').slideToggle(300);
                }*/
            getTableChecks();
            var title="体检安排";
            $('#planpanel').hide();

            var tjPlans=layer.open({
                type:1
                ,title:title
                ,content: $('#planpanel')
                ,skin: 'flowForm-lys'
                ,area:  ['800px','300px']
                ,cancel: function(){
                    $('#planpanel').hide();
                }
            });
        });

        //全选当页
      /*  $(document).delegate('.allcheckbox', 'click', function () {
            $('#tjusers').html('');
            $(this).parent().parent().parent().next().find('input[type=checkbox]').each(function () {
               /!* if ($(this).is(":checked")) {
                    $('#tjusers').append('<input type="hidden" name="uid" value="' + $(this).val() + '"/>');
                }*!/
                var ck = $(this);
                if (ck.is(":checked")) {
                    $('#tjusers').append('<input type="hidden" name="uid" value="' + $(this).val() + '"/>');
                    $('#msgusers').append('<input type="hidden" name="uid" value="' + $(this).val() + '"/>');
                    $('#rusers').append('<input type="hidden" name="uid" value="' + $(this).val() + '"/>');
                } else {
                    $('#tjusers input').each(function () {
                        if ($(this).val() == ck.val())
                            $(this).remove();
                    });
                    $('#rusers input').each(function () {
                        if ($(this).val() == ck.val())
                            $(this).remove();
                    });
                    $('#msgusers input').each(function () {
                        if ($(this).val() == ck.val())
                            $(this).remove();
                    });
                }

            });
        });*/
        //选择一条
       /* $(document).delegate('#tablelist tbody tr', 'click', function () {
            /!*var ck = $(this).find('input[type=checkbox]');
            if (ck.is(":checked")) {
                $('#tjusers').append('<input type="hidden" name="uid" value="' + ck.val() + '"/>');
            } else {
                $('#tjusers input').each(function () {
                    if ($(this).val() == ck.val())
                        $(this).remove();
                });

            }*!/
            var ck = $(this).find('input[type=checkbox]');
            if (ck.is(":checked")) {
                $('#tjusers').append('<input type="hidden" name="uid" value="' + ck.val() + '"/>');
                $('#msgusers').append('<input type="hidden" name="uid" value="' + ck.val() + '"/>');
                $('#rusers').append('<input type="hidden" name="uid" value="' + ck.val() + '"/>');
            } else {
                $('#tjusers input').each(function () {
                    if ($(this).val() == ck.val())
                        $(this).remove();
                });
                $('#msgusers input').each(function () {
                    if ($(this).val() == ck.val())
                        $(this).remove();
                });
                $('#rusers input').each(function () {
                    if ($(this).val() == ck.val())
                        $(this).remove();
                });
            }
        });*/

    var selectDataTemp = [];
    function getTableChecks(){
        var selectData = layui.table.checkStatus('listTables').data;

        if(selectDataTemp.length > 0){
            for(var i=0;i<selectDataTemp.length;i++){
                $('#tjusers input').each(function () {
                    if ($(this).val() == selectDataTemp[i].id_cb.replace('cb_', ''))
                        $(this).remove();
                });
                $('#msgusers input').each(function () {
                    if ($(this).val() == selectDataTemp[i].id_cb.replace('cb_', ''))
                        $(this).remove();
                });
                $('#rusers input').each(function () {
                    if ($(this).val() == selectDataTemp[i].id_cb.replace('cb_', ''))
                        $(this).remove();
                });
                $('#infosuers input').each(function () {
                    if ($(this).val() == selectDataTemp[i].id_cb.replace('cb_', ''))
                        $(this).remove();
                });
                $('#infosuerCardnos input').each(function () {
                    if ($(this).val() == selectDataTemp[i].CARDNO)
                        $(this).remove();
                });
            }
        }

        if(selectData.length == 0){
            selectDataTemp = selectData;
        }else{
            for(var i=0;i<selectData.length;i++){
                $('#tjusers').append('<input type="hidden" name="uid" value="' + selectData[i].id_cb.replace('cb_', '') + '"/>');
                $('#msgusers').append('<input type="hidden" name="uid" value="' + selectData[i].id_cb.replace('cb_', '')  + '"/>');
                $('#rusers').append('<input type="hidden" name="uid" value="' + selectData[i].id_cb.replace('cb_', '')  + '"/>');
                $('#infosuers').append('<input type="hidden" name="id" value="' + selectData[i].id_cb.replace('cb_', '') + '"/>');
                $('#infosuerCardnos').append('<input type="hidden" name="cardno" value="' + selectData[i].CARDNO + '"/>');
            }
            selectDataTemp = selectData;
        }
    }
        //体检通知
        $('#zzuser_tjmsg').click(function () {
            getTableChecks();
            $('#msgpanel').slideToggle(300);
            $(this).toggleClass('cur').blur().siblings().removeClass('cur');
            if (!$('#infospanel').is(":hidden")) {
                $('#infospanel').slideToggle(300);
            }
            if (!$('#resultpanel').is(":hidden")) {
                $('#resultpanel').slideToggle(300);
            }
          /*  if (!$('#planpanel').is(":hidden")) {
                $('#planpanel').slideToggle(300);
            }*/
        });

        $('#dxmb').change(function () {
            getMsg();
        });

        //导出体检人员信息
        $('#tj_out').click(function () {
            location = '/Do/ZZPhysical/DownAction?' + $('#sform').serialize();
        });

        $('#do_zznext').click(function () {
            parent.layer.confirm('只有体检合格的人员才能进入下一步，确定要执行吗？', {
                btn: ['是', '否']
            }, function () {
                //DelInfo('/Do/ZZPhysical/NextAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}');
                toNextFlowNew('/Do/ZZPhysical/NextAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}','${fid}');
                parent.layer.closeAll();
            }, function () {
                parent.layer.closeAll();
            });
        });

    //});

  /*  function getList() {
        $('.page').myPagination({
            cssStyle: "pagination",
            saveChecked:true,
            showTitle:false,
            rowNumber:false,
            ajax: {
                on: true,
                url: '${path}/Do/ZZPhysical/getusers?flowid=${fid}',
                param: $('#sform').serialize(),
                dataType: 'html',
                callback: function (data) {
                    $('#result').html(data);
                    $('#result select').each(function () {
                        $(this).val($(this).next().val());
                    });
                    parent.changeFrameHeight();
                    $('#result a').click(function () {
                        event.stopPropagation();
                    });
                }
            }
        });
    }*/

    function getMsg() {
        getAjax('${path}/Do/ZZPhysical/getMsg?code=' + $('#dxmb').val(), null, function (data) {
            $('textarea[name=dxnr]').val(data);
        });
    }

   // $(function () {
  //      $(function () {
            $('#resume_output').click(function () {
                openpLayer('请选择要导出的字段', '/ExcelDown/DownDoResumeBySearch?pid=${pid}&fid=${fid}&deptcode=${deptcode}&'+$('#sform').serialize(), '60%', '70%');
            });

            $('#resume_input').click(function () {
                openpLayer('Excel数据导入', '/ExcelImport/ImportExcelPage?pid=${pid}&fid=${fid}&deptcode=${deptcode}&'+$('#sform').serialize(), '60%', '70%');
            });
     //   });
    //})

 //   $(function () {
        fillSelectState("tjstate","${fid}");
   // })
    
    var ZzPhysicalTable;
    var sdat;

    layui.config({
        base: '<%=basepaths%>/resources/js/plugins/ext/',   // 模块目录
        version: 'v1.5.10' // 插件版本号
    }).extend({
        soulTable: 'soulTable',// 模块别名
        tableChild: 'tableChild',
        tableMerge: 'tableMerge',
        tableFilter: 'tableFilter',
        // excel: 'excel',
    });

    layui.use(['table','soulTable','tableChild','tableMerge','tableFilter'], function(){
        var soulTable = layui.soulTable,
            tableChild = layui.tableChild,
            tableMerge = layui.tableMerge,
            tableFilter = layui.tableFilter,
            $ = layui.$;

        ZzPhysicalTable = layui.table;
        sdat = '${path}/Do/ZZPhysical/getZzPhysicalListLayuiJson?flowid=${fid}&'+$('#sform').serialize();

        ZzPhysicalTable.render({
            id:'listTables'
            ,elem: '#tablelistZzPhysical'
            ,url: sdat
            ,title:'用户数据表'
            , height: 'full'
            //  ,cellMinWidth: 40 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
            ,contextmenu: {
                // 表格内容右键菜单配置
                body: [
                ]
            }
            ,cols: [[
                {type:'checkbox',fixed:'center'}
                ,{field:'id', title: '序号', fixed:'center',sort: true,minWidth:80}
                ,{field:'NAME',title: '姓名', fixed:'left',sort: true,minWidth:100,templet: function(d){
                         return '<a target="_blank" href="' + d.ContextPath + '">' +d.NAME;
                    }}
                ,{field:'SEXNAME',title: '性别', fixed:'center',minWidth:80}
                ,{field:'CARDNO',title: '身份证号', fixed:'center',minWidth:160}
                ,{field:'MAJOR', title: '专业', fixed:'center', sort: true,minWidth:110}
                ,{field:'JOB', title: '岗位', fixed:'center', sort: true,minWidth:130}
                ,{field:'TJTIME', title: '体检时间', fixed:'center', sort: true,minWidth:110}
                ,{field:'TJADDRESS', title: '体检地点', fixed:'center', sort: true,minWidth:200}
                ,{field:'TJLXRs', title: '联系人', fixed:'center', sort: true,minWidth:90}
                ,{field:'TJMSG', title: '短信通知', fixed:'center', sort: true,minWidth:110}
                ,{field:'TJSTATE', title: '体检结果', fixed:'center', sort: true,minWidth:110}
                ,{field:'TJREMARK', title: '体检备注', fixed:'center', sort: true,minWidth:110}
                ,{field:'arrange', title: '公布安排', fixed:'center', sort: true,minWidth:110,templet: function(d){
                        if(!d.arrange || d.arrange === "未公布")
                            return '<span class="layui-badge layui-bg-orange">未公布</span>';
                        else
                            return '<span class="layui-badge layui-bg-green">'+d.arrange+'</span>';
                    }}
                ,{field:'STATEb', title: '公布结果', fixed:'center', sort: true,minWidth:110,templet: function(d){
                        if(d.STATEb == "未公布")
                            return '<span class="layui-badge layui-bg-orange">'+d.STATEb+'</span>';
                        else
                            return '<span class="layui-badge layui-bg-green">'+d.STATEb+'</span>';
                    }}
                ,{field:'STATEc',  title: '', fixed:'center', sort: true,minWidth:50,templet: function(d){
                        switch(d.STATEc){
                            case "弃" :
                                return '<span class="layui-badge layui-bg-gray" title="已放弃">'+d.STATEc+'</span>';
                                break;
                            case "未" :
                                return '<span class="layui-badge layui-bg-orange" title="未完成">'+d.STATEc+'</span>';
                                break;
                            case "完" :
                                return '<span class="layui-badge layui-bg-green">'+d.STATEc+'</span>';
                                break;
                            default: '<span></span>'; break;
                        }}}
                ,{field:'STATEd',  title: '', fixed:'center',minWidth:100,templet: function(d){
                        if(d.NRID != "")
                            return   '<span class="layui-badge layui-bg-blue" title="转岗(原岗位:'+d.NJNAME+'")>'+d.STATEd+'</span>';
                        else
                            return '<span></span>';
                    }}
            ]]
            ,page: true
            , done: function () {
                soulTable.render(this);
            }
        });

        $("#searchbtn").on('click', () => {
            tableRenders();
        });
    });

    function tableRenders() {
        sdat = '${path}/Do/ZZPhysical/getZzPhysicalListLayuiJson?flowid=${fid}&'+$('#sform').serialize();
        //执行重载
        ZzPhysicalTable.reload('listTables', {
            url: sdat
            ,method: 'get'
            ,page:  {
                curr: 1 //重新从第 1 页开始
            }
            ,where: {
            }
        }, 'data');
    }

    //一键安排
    $('#tj_assignment').click(function () {
        getTableChecks();
        parent.layer.open({
            type: 2,
            title: "一键安排",
            shade: 0.5,
            area:  ['80%', '500px'],
            content: encodeURI('/Easy/EasyForm?pid=${pid}&fid=${fid}&deptcode=${deptcode}'),
            end:function () {
                location.reload();
            }
        });
    });

</script>
</body>
</html>